<!DOCTYPE html >
<html>
<head>
<meta charset=UTF-8>
<title>Insert title here</title>
<script>
function init()
{
	var source=document.getElementById("dragme");
	var dest=document.getElementById("text");
	
	souce.addEventListener("dragstart",function(ev)
			{
				var dt=ev.dataTransfer;
				dt.effectAllowed='all';
				dt.setData("text/plain","你好");
			},false
			);
	
	dest.addEventListener("dragend", function(ev)
			{
				ev.preventDefault();
			}, false);
	
	dest.addEventListener("drop",function(ev)
	{
		var dt=ev.dataTransfer;
		var text=dt.getData("text/plain");
		alert(text);
		dest.textContent+=text;
		ev.preventDefault();
		ev.stopPropagation();		
	},false);
	
	
}
document.ondragover=function(e){e.preventDefault();};
document.ondrop=function(e){e.preventDefault();};
</script>
</head>
<body onload="init">
<div id="dragme" draggable="true" style="width:200px;border:1px solid gray;">请拖放</div>
<div id="text" style="width:200px;border:1px solid gray;height:200px;"></div>

</body>
</html>